#include "iostream"
#define _CRT_SECURE_NO_WARNINGS
// more about getopt: https://www.gnu.org/software/libc/manual/html_node/Getopt.html
// getopt(argc, argv, optionstring)
// An option character in this string can be 
// followed by a colon (‘:’) to indicate that it takes a required argument. 
// If an option character is followed by two colons (‘::’), its argument is optional
// getopt is unavailiable ubder windows system...
// pre-conpiled code: http://ieng6.ucsd.edu/~cs12x/vc08install/vc08install2.html

extern int getopt(int nargc, char* const nargv[], const char* ostr);

int main(int argc, char** argv) {
    int optchar;
    extern const char* optarg;//argument
    while (EOF != (optchar = getopt(argc, argv, "ab:c::"))) {
        printf("%c handled para: %s\n", optchar, optarg);
        switch(optchar) {
            case 'a': 
                break;
            case 'b':
                break;
            case 'c':
                break;
            default:
                break;
        }
    }
    return 0;
}